<!--
  Licensed to the Apache Software
	Foundation (ASF) under one or more contributor license agreements. See the
	NOTICE file distributed with this work for additional information regarding
	copyright ownership. The ASF licenses this file to You under the Apache License,
	Version 2.0 (the "License"); you may not use this file except in compliance
	with the License. You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software distributed
	under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
	OR CONDITIONS OF ANY KIND, either express or implied. See the License for
  the specific language governing permissions and limitations under the License.
  -->
<div class="metron-slider-pane-edit fill load-left-to-right dialog2x">

  <div class="form-group">
      <div class="form-title">Configure Storm Settings</div>
      <i class="fa fa-times float-right close-button" aria-hidden="true" (click)="onCancel()"></i>
  </div>


  <form role="form" class="enrichments-form">
      <div class="form-group">
          <label attr.for="numWorkers">NUM WORKERS</label>
          <div style="width: 25%">
              <metron-config-number-spinner name="numWorkers" [(ngModel)]="newSensorParserConfig.numWorkers" [min]="1"> </metron-config-number-spinner>
          </div>
          <div><label *ngIf="!newSensorParserConfig.numWorkers"><span class="warning-text"> This uses Storm defaults if not set </span></label></div>
          <label *ngIf="newSensorParserConfig.numWorkers !== sensorParserConfig.numWorkers"><span class="warning-text"> This change requires a parser topology restart </span></label>
      </div>
      <div class="form-group">
          <label attr.for="numAckers">NUM ACKERS</label>
          <div style="width: 25%">
              <metron-config-number-spinner name="numAckers" [(ngModel)]="newSensorParserConfig.numAckers" [min]="1"> </metron-config-number-spinner>
          </div>
          <div><label *ngIf="!newSensorParserConfig.numAckers"><span class="warning-text"> This uses Storm defaults if not set </span></label></div>
          <label *ngIf="newSensorParserConfig.numAckers !== sensorParserConfig.numAckers"><span class="warning-text"> This change requires a parser topology restart </span></label>
      </div>
      <div class="form-group">
          <label attr.for="spoutParallelism">SPOUT PARALLELISM</label>
          <div style="width: 25%">
              <metron-config-number-spinner name="spoutParallelism" [(ngModel)]="newSensorParserConfig.spoutParallelism" [min]="1"> </metron-config-number-spinner>
          </div>
          <label *ngIf="newSensorParserConfig.spoutParallelism !== sensorParserConfig.spoutParallelism"><span class="warning-text"> This change requires a parser topology restart </span></label>
      </div>
      <div class="form-group">
          <label attr.for="spoutNumTasks">SPOUT NUM TASKS</label>
          <div style="width: 25%">
              <metron-config-number-spinner name="spoutNumTasks" [(ngModel)]="newSensorParserConfig.spoutNumTasks" [min]="1"> </metron-config-number-spinner>
          </div>
          <label *ngIf="newSensorParserConfig.spoutNumTasks !== sensorParserConfig.spoutNumTasks"><span class="warning-text"> This change requires a parser topology restart </span></label>
      </div>
      <div class="form-group">
          <label attr.for="parserParallelism">PARSER PARALLELISM</label>
          <div style="width: 25%">
              <metron-config-number-spinner name="parserParallelism" [(ngModel)]="newSensorParserConfig.parserParallelism" [min]="1"> </metron-config-number-spinner>
          </div>
          <label *ngIf="newSensorParserConfig.parserParallelism !== sensorParserConfig.parserParallelism"><span class="warning-text"> This change requires a parser topology restart </span></label>
      </div>
      <div class="form-group">
          <label attr.for="parserNumTasks">PARSER NUM TASKS</label>
          <div style="width: 25%">
              <metron-config-number-spinner name="parserNumTasks" [(ngModel)]="newSensorParserConfig.parserNumTasks" [min]="1"> </metron-config-number-spinner>
          </div>
          <label *ngIf="newSensorParserConfig.parserNumTasks !== sensorParserConfig.parserNumTasks"><span class="warning-text"> This change requires a parser topology restart </span></label>
      </div>
      <div class="form-group">
          <label attr.for="errorWriterParallelism">ERROR WRITER PARALLELISM</label>
          <div style="width: 25%">
              <metron-config-number-spinner name="errorWriterParallelism" [(ngModel)]="newSensorParserConfig.errorWriterParallelism" [min]="1"> </metron-config-number-spinner>
          </div>
          <label *ngIf="newSensorParserConfig.errorWriterParallelism !== sensorParserConfig.errorWriterParallelism"><span class="warning-text"> This change requires a parser topology restart </span></label>
      </div>
      <div class="form-group">
          <label attr.for="errorWriterNumTasks">ERROR WRITER NUM TASKS</label>
          <div style="width: 25%">
              <metron-config-number-spinner name="errorWriterNumTasks" [(ngModel)]="newSensorParserConfig.errorWriterNumTasks" [min]="1"> </metron-config-number-spinner>
          </div>
          <label *ngIf="newSensorParserConfig.errorWriterNumTasks !== sensorParserConfig.errorWriterNumTasks"><span class="warning-text"> This change requires a parser topology restart </span></label>
      </div>
      <div class="form-group">
          <label attr.for="newSpoutConfig">SPOUT CONFIG</label>
          <metron-config-ace-editor [(ngModel)]="newSpoutConfig" [ngModelOptions]="{standalone: true}" [type]="'JSON'" [placeHolder]="'Enter Spout Config'"> </metron-config-ace-editor>
          <label *ngIf="hasSpoutConfigChanged()"><span class="warning-text"> This change requires a parser topology restart </span></label>
      </div>
      <div class="form-group">
          <label attr.for="newStormConfig">STORM CONFIG</label>
          <metron-config-ace-editor [(ngModel)]="newStormConfig" [ngModelOptions]="{standalone: true}" [type]="'JSON'" [placeHolder]="'Enter Storm Config'"> </metron-config-ace-editor>
          <label *ngIf="hasStormConfigChanged()"><span class="warning-text"> This change requires a parser topology restart </span></label>
      </div>

      <div class="form-group">
          <div class="form-seperator-edit"></div>
          <div class="button-row">
              <button type="submit" class="btn form-enable-disable-button" (click)="onSave()">SAVE</button>
              <button class="btn form-enable-disable-button ml-1" (click)="onCancel()" >CANCEL</button>
          </div>
      </div>

  </form>

</div>
